<?php
abstract class Epic_Form_Decorator_Abstract implements Epic_Form_Element_Interface
{
	/**#@+
	 * Constants for position 
	 */
    const APPEND  = 'APPEND';
    const PREPEND = 'PREPEND';

    /**
     * Default position is APPEND
     * @var string
     */
    protected $_placement = 'APPEND';
    
    /**
     * Content decoration
     * @var string
     */
    protected $_text;
	
	/**
     * Form element
     * @var Epic_Form_Element_Abstract
     */
    protected $_element;

    /**
     * Contructor
     * 
     * @param Epic_Form_Element_Abstract $input
     * @return void
     */
    public function __construct(Epic_Form_Element_Abstract $input, array $option = array())
    {
    	if ($option) {
    		$this->setOptions($option);
    	}
        $this->_element = $input;
    }
    
    /**
     * Retrive current content Html Element
     *
     * @return Epic_Form_Element_Abstract
     */
    public function getContentElement()
    {
    	return $this->_element->getContent();
    }
    
    /**
     * Set opption
     *
     * @param  array $options
     */
    public function setOptions(array $options)
    {
        $this->_text = $options['text'];
        if (isset($options['placement']))
        $this->_placement = $options['placement'];
    }
    
    /**
     * Retrive position decorator
     *
     * @return string
     */
    public function getPlacement()
    {
        return $this->_placement;
    }
    
    /**
     * Retrive Content decoration
     *
     * @return string
     */
    public function getText()
    {
        return $this->_text;
    }
}